﻿<phone:PhoneApplicationPage 
    x:Class="CalciumTemplateApp.Views.Examples.PreventsNavigationView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:c2="clr-namespace:DanielVaughan.Windows;assembly=Calcium.Phone"
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit" 
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="768"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    shell:SystemTray.IsVisible="{Binding AppSettings.SystemTrayVisible, FallbackValue=true}"
    c2:VisualStateUtility.VisualState="{Binding VisualState}"
    Style="{StaticResource PageStyle}">

    <Grid x:Name="ContentPanel" Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        
        <StackPanel>
            <TextBlock TextWrapping="Wrap">
                When the toggle switch is On, 
                navigation is prevented and you are returned to this pivot item. 
                Note: you should not prevent back navigation without confirmation 
                (as is demonstrated in the next pivot item).
            </TextBlock>

            <toolkit:ToggleSwitch 
                Header="prevent navigation away" 
                IsChecked="{Binding PreventNavigation, Mode=TwoWay}" />
        </StackPanel>
    </Grid>
 
</phone:PhoneApplicationPage>